/*
 * Copyright (c) 2021.版权所有高金磊
 */

package 领扣算法.A简单题.检查二进制字符串字段;

public class Main {
    public boolean checkOnesSegment(String s) {
        boolean flag=false;
        for (char c : s.toCharArray()) {
            switch (c){
                case '1':
                    if (flag)
                        return false;
                    break;
                case '0':
                    flag=true;
            }
        }
        return true;
    }
}
